package com.zzyk.main.mapper;

import com.zzyk.main.model.pojo.DeviceUserate;
import com.zzyk.main.model.vo.KeyValueTwo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface DeviceUserateMapper {
    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(DeviceUserate record);

    /**
     * 根据设备ID获取生产率
     *
     * @param deviceId
     * @param bDate
     * @param eDate
     * @return
     */
    List<DeviceUserate> selectAllByDeviceId(@Param("deviceId") Integer deviceId, @Param("bDate") Date bDate, @Param("eDate") Date eDate);

    List<DeviceUserate> selectAllByEnterprise(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("enterprise") Integer enterprise, @Param("deviceList") Integer[] deviceList);

    List<KeyValueTwo> selectDeviceTypeUtilizationRate(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("enterprise") Integer enterprise, @Param("deviceList") Integer[] deviceList);

    List<Map<Object, Object>> selectAnnualUtilizationRate(@Param("year") String year, @Param("enterprise") Integer enterprise, @Param("deviceList") Integer[] deviceList);

}